package com.lin.missyou.core.enumeration;

import java.util.stream.Stream;

/**
 * 优惠卷类型
 * @author gcq
 * @Create 2021-11-09
 */
public enum CouponType {

    FULL_MINUS(1,"满减卷"),
    FULL_OFF(2,"满减折扣卷"),
    NO_THRESHOLD_MINUS(3,"无门槛减除卷"),
    ;
    private int value;

    CouponType(int value, String description)
    {
        this.value = value;
    }

    CouponType() {
        this.value = value;
    }

    public static CouponType toType(int value)
    {
        return Stream.of(CouponType.values())
                .filter(c -> c.value == value)
                .findAny()
                .orElse(null);
    }


}